<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html  xmlns="http://www.w3.org/1999/xhtml"
       xmlns:ui="http://java.sun.com/jsf/facelets"
       xmlns:h="http://java.sun.com/jsf/html"
       xmlns:f="http://java.sun.com/jsf/core"
       xmlns:p="http://primefaces.org/ui">
    <ui:composition template="../TemplateAdmin.xhtml">
        <ui:define name="title">
            <h:outputText value="OrderDetail"></h:outputText>
        </ui:define>       
        <ui:define name="body">
            <h:form>
                <h:panelGrid columns="2" >
                    <h:outputText value="Order ID :"/>
                    <h:outputText value="#{orderController.selected.odID}" title="OrderID"/>
                    <h:outputText value=""/>
                    <h:outputText value=""/>
                    <h:outputText value="User :"/>
                    <p:commandLink id="UserDetail" value="#{orderController.selected.usID.usUserName}" title="UserID" />               
                    <h:outputText value="Manager :"/>
                    <h:outputText value="#{orderController.selected.mnID.mnUserName}" title="Manager"/> 
                    <h:outputText value="City :"/>
                    <h:outputText value="#{orderController.selected.odCity}" title="City"/> 
                    <h:outputText value="Country :"/>
                    <h:outputText value="#{orderController.selected.odCountry}" title="Country"/> 
                    <h:outputText value="Created Date :"/>
                    <h:outputText value="#{orderController.selected.odCreated}" title="Created Date"> 
                        <f:convertDateTime pattern="MM/dd/yyyy " />
                    </h:outputText>
                    <h:outputText value="Total :"/>
                    <h:outputText value="#{orderController.selected.odTotal}" title="odTotal"/>              
                </h:panelGrid>
                <p:overlayPanel id="DetailsUserPanel" for="UserDetail" hideEffect="fade" dynamic="true">  
                    <h:panelGrid columns="2" >
                        <h:outputText value="ID :"/>
                        <h:outputText value="#{orderController.selected.usID.usID}" title="ID"/>
                        <h:outputText value="Name :"/>
                        <h:outputText value="#{orderController.selected.usID.usName}" title="Name"/>
                        <h:outputText value="UserName"/>
                        <h:outputText value="#{orderController.selected.usID.usUserName}" title="UserName"/>
                        <h:outputText value="Email :"/>
                        <h:outputText value="#{orderController.selected.usID.usEmail}" title="Email"/>
                        <h:outputText value="Address :"/>
                        <h:outputText value="#{orderController.selected.usID.usAdress}" title="Address"/>
                        <h:outputText value="Phone :"/>
                        <h:outputText value="#{orderController.selected.usID.usPhone}" title="Phone"/>  
                        <h:outputText value="Status :"/>
                        <h:outputText value="#{orderController.selected.usID.usStatus}" title="Status"/>   
                    </h:panelGrid>
                </p:overlayPanel> 
                <br />
                <br />
            </h:form>
            <h:form id="form2">
                <h:panelGroup>
                    <p:growl id="messages" showDetail="true"/>
                    <p:dataTable id="dataTable" var="item" value="#{orderController.selected.tblOrderDetailList}" 
                                 paginator="true" rows="5" paginatorPosition="bottom" resizableColumns="true"
                                 paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
                                 rowsPerPageTemplate="5,10,15" style="width: 100%" widgetVar="projectDetailTable">	
                        <f:facet name="header">
                            <h:outputText value="Order Detail"/>
                        </f:facet>
                        <p:column sortBy="#{item.tblOrder.odID}" headerText="Order ID" >                                        
                            <h:outputText value="#{item.tblOrder.odID}"/>                                                  
                        </p:column>

                        <p:column sortBy="#{item.tblElevation.elName}" headerText="Elevation" >
                            <h:outputText value="#{item.tblElevation.elName}"/>
                        </p:column>
                        <p:column  headerText="Quantity">                        
                            <h:outputText value="#{item.oddQuantity}"/>                          
                        </p:column>
                        <p:column  headerText="Price">                        
                            <h:outputText value="#{item.oddPrice}"/>                          
                        </p:column>
                    </p:dataTable>
                </h:panelGroup>
                <br/>
                <br/>

            </h:form>

        </ui:define>
    </ui:composition>
</html>

